package com.zqwh.xtool.api.online;


import com.zqwh.yj.sdk.utils.httpRequest.beans.HttpResult2;
import com.zqwh.xtool.domain.UserVO;
import com.zqwh.xtool.domain.UserTemplatesVO;

import java.util.List;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by eason.yang on 2018/1/19.
 */
public interface UserApi {
    /**
     * 刷卡登录
     * @return
     */
    @POST("user/login/card")
    @FormUrlEncoded
    Observable<HttpResult2<UserVO>> signInByCardNo(@Field("devId") Long devId, @Field("cardNo") String cardNo);

    /**
     * 账号密码登录
     * @return
     */
    @POST("user/login/account")
    @FormUrlEncoded
    Observable<HttpResult2<UserVO>> signInByAccount(@Field("devId") Long devId, @Field("username") String username, @Field("password") String password);

    /**
     * ID登录
     * @return
     */
    @POST("user/login/vein")
    @FormUrlEncoded
    Observable<HttpResult2<UserVO>> signInById(@Field("devId") Long devId, @Field("userId") Long userId);

    /**
     * 获取指静脉模板
     * @return
     */
    @GET("user/template/list")
    Observable<HttpResult2<List<UserTemplatesVO>>> getTemplateList();

    /**
     * 设置指静脉模板
     * @return
     */
    @POST("user/template")
    @FormUrlEncoded
    Observable<HttpResult2<Object>> setTemplate(@Header("Authorization") String token,
                                        @Field("userId") Long userId,
                                        @Field("templateNum") Integer templateNum,
                                        @Field("template") String template);
}
